package thanhnguyen.helloworld.mystring;

/*
Basic string problems -- no loops. Use + to combine Strings, str.length() is the number of chars in
a String, str.substring(i, j) extracts the substring starting at index i and running up to but not
including index j.
 */

public class MyString {
	public static String front3(String str) {
		String front = "";
		if (str.length() >= 3) {
			front = str.substring(0, 3);
		} else {
			front = str;
		}
		return front + front + front;
	}

	public static String backAround(String str) {
		// Get the last char
		String last = str.substring(str.length() - 1);
		return last + str + last;
	}
}
